/*
 * @ author madman 
 * @ use 后台角色表
 */
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
var shortid = require('shortid');
const AdminRoleSchema = new Schema({
    _id: {
        type: String,
        'default': shortid.generate
    },
    // 角色名
    name: {
        type: String,
        required: true
    },
    //角色介绍
    description: {
        type: String,
        required: true
    },
    // 排序数
    sort: {
        type: String,
        required: true
    },
    //权限列表
    power: {
        type: Array,
        required: true
    },
    // 锁
    isLock: {
        type: Boolean,
        required: false
    },
    //新建时间
    createdAt: {
        type: Date,
        default: Date.now
    },
    // 更新时间
    updataAt: {
        type: Date,
        default: Date.now
    },

});
module.exports = mongoose.model('j_admin_roles', AdminRoleSchema, 'j_admin_roles');